.sidebar {
	position: absolute;
	display: flex;
	top: 0px;
	left: calc(var(--tla-sidebar-width) * -1);
	height: 100%;
	width: var(--tla-sidebar-width);
	z-index: 100;
	transform: translate(0px, 0px);
	flex-direction: column;
	flex: 0 0 auto;
	padding: 3px 12px 0px 12px;
	background: var(--tla-color-sidebar);
	border-right: 1px solid transparent;
	transition: transform 0.16s ease-in-out;
}

.sidebarDragOverlay {
	position: absolute;
	inset: 0px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 600;
	z-index: 1000;
	background-color: var(--tla-color-sidebar);
	content: 'Upload .tldr files';
	opacity: 0;
	animation: 0.2s fade-in 0.25s forwards;
}

@keyframes fade-in {
	0% {
		opacity: 0;
	}
	100% {
		opacity: 1;
	}
}

.sidebarOverlayMobile {
	all: unset;
	position: absolute;
	top: 0px;
	left: 0px;
	width: 100%;
	height: 100%;
	z-index: 99;
	background-color: var(--tla-color-overlay);
	display: none;
}

@media (min-width: 768px) {
	.sidebar {
		border-right: 1px solid var(--tl-color-low);
	}
	.sidebar[data-visible='true'] {
		transform: translate(100%, 0px);
		transition: transform 0.22s ease-out;
	}
}

@media (max-width: 767px) {
	.sidebar {
		--w: min(320px, max(220px, calc(100vw - 100px)));
		left: calc(var(--w) * -1);
		width: var(--w);
		transition: none;
	}

	.sidebar[data-visiblemobile='true'] {
		transform: translate(100%, 0px);
	}

	.sidebarOverlayMobile[data-visiblemobile='true'] {
		display: block;
	}
}

.sidebarContent {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	margin: 0px -12px;
	padding: 2px 12px 40px 12px;
	overflow-y: scroll;
	overflow-x: visible;
	-ms-overflow-style: none; /* IE and Edge */
	scrollbar-width: none; /* Firefox */
}

.sidebarContent::-webkit-scrollbar {
	display: none;
}

/* -------------------- Hoverable ------------------- */

.hoverable::after {
	display: block;
	content: '';
	position: absolute;
	top: 2px;
	left: 0px;
	right: 0px;
	bottom: 2px;
	border-radius: 4px;
	background-color: var(--tla-color-hover-1);
	z-index: 0;
	pointer-events: none;
	visibility: hidden;
}

.hoverable:has(*[data-state='open'])::after,
.hoverable[data-active='true']::after {
	background-color: var(--tla-color-hover-2);
	visibility: visible;
}

.hoverable:has(*[data-state='open']) .collaborator {
	display: none;
}

@media (hover: hover) {
	.hoverable:hover::after {
		visibility: visible;
	}

	.hoverable {
		color: var(--tla-color-text-2);
	}
	.hoverable[data-active='true'],
	.hoverable:hover {
		color: var(--tla-color-text-1);
	}
}

/* ----------------- Sidebar toggle ----------------- */

.sidebarToggle {
	position: relative;
	background: none;
	border: none;
	cursor: pointer;
	width: 40px;
	height: 40px;
	color: var(--tla-color-text-1);
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: all;
	flex-shrink: 0;
	padding: 0px;
}

.sidebarToggle::after {
	display: block;
	content: '';
	position: absolute;
	top: 4px;
	left: 4px;
	right: 4px;
	bottom: 4px;
	border-radius: 4px;
	pointer-events: none;
	z-index: 0;
	visibility: hidden;
	background-color: var(--tla-color-hover-1);
}

.sidebarToggle:focus-visible {
	border-radius: 8px;
	outline-offset: -4px;
	outline: 2px solid var(--tl-color-focus);
}

@media (hover: hover) {
	.sidebarToggle:hover {
		z-index: 100;
	}

	.sidebarToggle:hover::after {
		visibility: visible;
	}
}

.sidebarToggle[data-mobile='true'] {
	display: flex;
}

.sidebarToggle[data-mobile='false'] {
	display: none;
}

@media (min-width: 768px) {
	.sidebarToggle[data-mobile='true'] {
		display: none;
	}

	.sidebarToggle[data-mobile='false'] {
		display: flex;
	}
}

/* --------------------- Top area -------------------- */

.sidebarTopRow {
	display: flex;
	flex-direction: row;
	align-items: center;
	flex: 0 0 auto;
}

/* Workspace link (sort of) */

.sidebarWorkspaceButton {
	background: none;
	border: none;
	position: relative;
	height: 40px;
	flex-grow: 2;
	display: flex;
	align-items: center;
	padding-right: 6px;
	padding-left: 8px;
	background-color: var(--tla-color-sidebar);
	overflow: hidden;
	padding-bottom: 1px;
}

.sidebarWorkspaceButtonLabel {
	/* for alignment with other buttons */
	display: block;
	flex-grow: 2;
	flex: 1 1 auto;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding: 0 0px;
	position: relative;
	z-index: 1;
}

/* Create file button */

.sidebarCreateFileButton {
	background: none;
	border: none;
	cursor: pointer;
	position: relative;
	top: 0.5px;
	right: -8px;
	height: 40px;
	width: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: inherit;
	flex-shrink: 0;
	padding: 0px;
	z-index: 10;
}

.sidebarCreateFileButton::after {
	display: block;
	content: '';
	position: absolute;
	top: 4px;
	left: 4px;
	right: 4px;
	bottom: 4px;
	border-radius: 4px;
	pointer-events: none;
	z-index: 0;
	visibility: hidden;
	background-color: var(--tla-color-hover-1);
}

.sidebarCreateFileButton:focus-visible {
	border-radius: 8px;
	outline-offset: -4px;
}

@media (hover: hover) {
	.sidebar:hover .sidebarCreateFileButton:hover::after {
		visibility: visible;
	}
}

/* ------------------- Bottom area ------------------ */

.sidebarBottomArea {
	display: flex;
	flex-direction: column;
	flex: 0 0 auto;
	margin-top: 0px;
}

/* ------------------- Bottom row ------------------- */

.sidebarBottomRow {
	display: flex;
	flex-direction: row;
	align-items: center;
	flex: 0 0 auto;
}

/* User settings menu */

.sidebarUserSettingsTrigger {
	background: none;
	border: none;
	position: relative;
	height: 40px;
	flex-grow: 2;
	display: flex;
	align-items: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding-right: 6px;
	padding-left: 2px;
	padding: 0px 0px 0px 8px;
	gap: 0px;
	text-align: left;
	cursor: pointer;
}

.sidebarUserSettingsTrigger:focus-visible {
	border-radius: 10px;
	outline-offset: -5px;
}

.sidebarUserSettingsTrigger::after {
	inset: 2px 8px 2px 0px;
}

.sidebarUserSettingsName {
	flex: 1 1 auto;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--tla-color-text-1);
}

.sidebarUserSettingsIcon {
	margin-right: 16px;
	color: var(--tla-color-text-3);
}

@media (hover: hover) {
	.sidebarUserSettingsTrigger:hover {
		color: var(--tla-color-text-1);
	}

	.sidebarUserSettingsIcon {
		color: var(--tla-color-text-3);
		visibility: hidden;
	}

	.sidebarUserSettingsTrigger:hover .sidebarUserSettingsIcon {
		visibility: visible;
		color: var(--tla-color-text-1);
	}
}

.sidebarUserSettingsTrigger[data-state='open']::after {
	visibility: visible;
}

.sidebarUserSettingsTrigger[data-state='open'] .sidebarUserSettingsIcon {
	visibility: visible;
}

/* Help menu */

.sidebarHelpMenuTrigger {
	height: 28px;
	width: 28px;
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	position: relative;
	cursor: pointer;
	border: none;
	color: var(--tla-color-text-3);
	background: none;
	margin-right: -2px;
}

.sidebarHelpMenuTrigger::after {
	border-radius: 100%;
	inset: 4px;
	visibility: visible;
	border: 1px solid var(--tla-color-border);
	background-color: transparent;
}

@media (hover: hover) {
	.helpMenuTrigger:hover::after {
		background-color: var(--tla-color-hover-1);
	}
}

.sidebarHelpMenuTrigger[data-state='open']::after {
	background-color: var(--tla-color-hover-1);
	visibility: visible;
}

.sidebarHelpMenuTrigger:focus-visible {
	outline-offset: 2px;
}

/* ---------------- File link section --------------- */

.sidebarFileSectionWrapper {
	margin-top: 8px;
}

.sidebarFileSection {
	position: relative;
	background: var(--tla-color-sidebar);
}

.sidebarFileSectionTitle {
	position: relative;
	width: 100%;
	height: 36px;
	padding: 0px 0px 0px 8px;
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 4px;
	font-weight: bold;
	color: var(--tla-color-text-3);
}

.sidebarFileSectionTitlePadding span[role='img'] {
	margin-bottom: 1px;
}

/* ------------------- File links ------------------- */

.sidebarFileListItem {
	background-color: transparent;
	/* Chrome hack to enable the drag image to have a transparent background */
	opacity: 0.999;
	position: relative;
	width: 100%;
	display: flex;
	flex-direction: row;
	align-items: center;
	height: 36px;
	padding: 0px 8px 0px 8px;
}

.sidebarFileListItem[data-active='true'][data-enhanced-a11y-mode='true'] {
	border-radius: 4px;
	outline: 2px solid var(--tl-color-text);
	outline-offset: -2px;
}

.sidebarFileListItem[data-is-dragging='true'] {
	opacity: 0.5;
	background: transparent;
}

.sidebarFileListItemContent {
	flex: 1 1 auto;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	position: relative;
	pointer-events: none;
	z-index: 2;
}

.sidebarFileListItemLabel {
	flex: 1 1 auto;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding: 0 0px;
	position: relative;
	z-index: 1;
	padding: 0px;
	flex: 0 1 auto;
}

.sidebarFileListItemRenameInputWrapper {
	background-color: var(--tla-color-sidebar);
	outline: 1px solid var(--tl-color-primary);
	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding: 0px 8px 0px calc(8px + var(--tla-sidebar-group-item-padding-left, 0px));
	outline-offset: -2px;
	gap: 8px;
	position: relative;
}

.sidebarFileListItemRenameInputWrapper::before {
	content: '';
	position: absolute;
	bottom: 0px;
	inset: 0px;
	border-radius: 6px;
	background-color: white;
	border: 1px solid var(--tla-color-primary);
}

.sidebarFileListItemRenameInputWrapper div:global(.tlui-input__wrapper) {
	height: 36px;
}

.sidebarFileListItemRenameInput {
	height: 36px;
	align-self: flex-start;
	flex: 1 1 auto;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	position: relative;
	z-index: 1;
}

.sidebarFileListItemButton {
	padding: 0px;
	background: none;
	border: none;
	position: absolute;
	top: 0px;
	left: 3px;
	width: calc(100% - 6px);
	height: 100%;
	cursor: pointer;
	z-index: 2;
	pointer-events: all;
}

.sidebarFileListItemButton:focus-visible {
	border-radius: 4px;
	outline-offset: 0px;
}

.sidebarFileListItemMenuTrigger {
	padding: 0px;
	background: none;
	border: none;
	position: relative;
	outline: none;
	margin-right: -10px;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--tla-color-text-3);
	flex: 0 0 auto;
	z-index: 3;
	cursor: pointer;
}

.sidebarFileListItemMenuTrigger:focus-visible {
	border-radius: 8px;
	outline-offset: -4px;
}

@media (hover: hover) {
	.sidebarFileListItemMenuTrigger {
		display: none;
	}
	/*
		For guest files we show a guest icon at the end of the filename
		but we don't want it to jump out of the way when the user hovers
	*/
	.sidebarFileListItem[data-is-own-file='false'] .sidebarFileListItemMenuTrigger {
		visibility: hidden;
		display: flex;
	}
	:global(.tla:has(.tl-container__focused:not(.tl-container__no-focus-ring)))
		.sidebarFileListItemMenuTrigger,
	.sidebarFileListItem[data-is-dragging='true'] .sidebarFileListItemMenuTrigger {
		visibility: visible;
		display: flex;
	}

	.sidebarFileListItem .sidebarFileListItemMenuTrigger[data-state='open'],
	.sidebarFileListItem:hover .sidebarFileListItemMenuTrigger {
		visibility: visible;
		display: flex;
	}

	.sidebarFileListItemMenuTrigger:hover {
		color: var(--tla-color-text-1);
	}
}

/* Renaming */

.sidebarFileLinkRenameInputWrapper {
	background-color: var(--tla-color-sidebar);
	outline: 1px solid var(--tl-color-primary);
	outline-offset: -2px;
	border-radius: 6px;
}

.sidebarFileLinkRenameInputWrapper > div {
	height: 36px;
	padding: 0px 8px 0px 8px;
}

.sidebarFileLinkRenameInput {
	height: 36px;
	flex: 1 1 auto;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	position: relative;
	z-index: 1;
}

/* Guest badge */

.sidebarFileListItemGuestBadge {
	display: inline-flex;
	pointer-events: none;
	flex: 0 0 auto;
}

.sidebarFileListItemGuestBadgeTrigger {
	margin-left: 4px;
	border-radius: 50%;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	outline: none;
	border: none;
	width: 14px;
	height: 14px;
	z-index: 3;
	padding: 0;
	background: none;
	pointer-events: all;
	cursor: pointer;
	color: var(--tla-color-text-1);
}

/* Dot dev link */

.sidebarDotDevLink {
	position: relative;
	font-size: 12px;
	border: 1px solid var(--tla-color-text-2);
	border-radius: 2px;
	margin-left: -4px;
	margin-right: -6px;
	margin-bottom: 8px;
	padding: 2px;
	display: flex;
	align-items: center;
	height: 36px;
	justify-content: space-between;
	background-color: var(--tla-color-sidebar);
}

.sidebarDotDevLink:after {
	content: '';
	position: absolute;
	top: 4px;
	left: -4px;
	right: 4px;
	bottom: -4px;
	border-radius: 2px;
	border: 1px dashed var(--tla-color-text-2);
	z-index: -2;
	pointer-events: none;
}

.sidebarDotDevLink a {
	position: relative;
	height: 100%;
	padding: 0px 8px;
	display: flex;
	align-items: center;
	flex: 1;
	gap: 4px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sidebarDotDevLink a div {
	position: relative;
	transform: rotate(180deg);
	flex-shrink: 0;
	transition: transform 3s ease-in-out 0s;
}

.sidebarDotDevDismissButton {
	background: none;
	border: none;
	cursor: pointer;
	position: relative;
	height: 28px;
	width: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--tla-color-inactive);
	transition: opacity 0.2s ease-in-out;
}

.sidebarDotDevDismissButton div {
	width: 12px;
	height: 12px;
}

@media (hover: hover) {
	.sidebarDotDevLink:hover a div {
		transform: translate(80px, 0px) rotate(180deg);
		transition: transform 6s ease-in-out 1s;
	}

	.sidebarDotDevLink:has(a:hover) .sidebarDotDevDismissButton {
		opacity: 0;
	}

	.sidebarDotDevLink:has(a:hover):after {
		background-color: var(--tla-color-hover-2);
	}
}

/* ------------------- Show all button ------------------- */

.showAllButton {
	background: none;
	border: none;
	padding: 0px 8px 8px;
	margin-top: 12px;
	color: var(--tla-color-text-3);
	font-size: 12px;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	border-radius: 4px;
	flex-shrink: 0;
	text-align: left;
	width: 100%;
}

.sidebarGroupItem .showAllButton {
	padding-left: calc(8px + var(--tla-sidebar-group-item-padding-left));
}

.showAllButton:hover {
	color: var(--tla-color-text-1);
}

.sidebarFileSectionTitleText {
	flex: 1 1 auto;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ------------------- Group Item ------------------- */

.sidebarGroupItem {
	position: relative;
	overflow: visible;
	width: 100%;
	margin-bottom: 0px;
	transition: margin-bottom 0.15s cubic-bezier(0.4, 0, 0.2, 1);
	--tla-sidebar-group-item-padding-left: 8px;
}
.sidebarGroupItem .sidebarFileListItemContent {
	padding-left: var(--tla-sidebar-group-item-padding-left);
}
.dropping {
	position: relative;
}

.dropping::after {
	content: '';
	position: absolute;
	inset: -2px;
	border-radius: 6px;
	border: 2px solid rgba(0, 122, 255, 0.7);
	pointer-events: none;
	visibility: visible;
}

.dropCursorLine {
	height: 2px;
	/* translateZ() is required to render at a consistent visual size */
	transform: translateZ(0) translateY(-50%);
	will-change: top;
	background-color: rgba(0, 122, 255, 0.7);
	border-radius: 1.5px;
	width: calc(100% - 32px);
	left: 16px;
	z-index: 1000;
	pointer-events: none;
	position: fixed;
}
.sidebarGroupItem[data-state='open'] {
	margin-bottom: 12px;
}
.sidebarGroupItem:has(.sidebarGroupItemHeader:hover)::after,
.sidebarGroupItem[data-is-empty='true'][data-is-expanded='true'][data-group-index='0']::after,
.sidebarGroupItem[data-menu-open='true']::after,
.sidebarGroupItem[data-is-dragging='true']::after {
	display: block;
	content: '';
	position: absolute;
	top: -2px;
	left: -4px;
	right: -4px;
	bottom: -2px;
	border-radius: 4px;
	background-color: var(--tla-color-drop-zone);
	z-index: 0;
	pointer-events: none;
	visibility: visible;
}

.sidebarGroupItem[data-is-dragging='true'] {
	opacity: 0.5;
}

.sidebarGroupItemHeader {
	background: none;
	border: none;
	position: relative;
	width: 100%;
	height: 36px;
	padding: 0px 8px 0px 8px;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	overflow: hidden;
	gap: 8px;
	cursor: pointer;
	color: var(--tla-color-text-1);
}

@media (hover: hover) {
	.sidebarGroupItemTitle:hover,
	.sidebarGroupItem[data-is-dragging='true'] .sidebarGroupItemTitle {
		color: var(--tla-color-text-1);
	}
}

.sidebarGroupItemCaret {
	color: var(--tla-color-text-3);
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
}

.sidebarGroupItemTitle {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 6px 10px 6px 0px;
	flex: 0 1 auto;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	position: relative;
	z-index: 1;
	text-align: left;
}

.sidebarGroupItemContent {
	display: flex;
	flex-direction: column;
	margin-bottom: 24px;
}

.sidebarGroupItemButtons {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 4px;
	margin-left: auto;
	opacity: 0;
	transition: opacity 0.15s ease-in-out;
}

@media (hover: hover) {
	.sidebarGroupItem:has(.sidebarGroupItemHeader:hover) .sidebarGroupItemButtons,
	.sidebarGroupItem[data-menu-open='true'] .sidebarGroupItemButtons,
	.sidebarGroupItem[data-is-dragging='true'] .sidebarGroupItemButtons {
		opacity: 1;
	}
}

@media (max-width: 767px) {
	.sidebarGroupItemButtons {
		opacity: 1;
	}
}

.sidebarGroupEmptyStateIcon {
	margin-left: 2px;
	margin-right: 1px;
	scale: 0.8;
}

.sidebarGroupItemButton {
	background: none;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 4px;
	color: var(--tla-color-text-3);
	cursor: pointer;
	position: relative;
	z-index: 1;
}

.sidebarGroupItemButton::before {
	position: absolute;
	inset: -8px -8px -8px -2px;
	content: '';
	pointer-events: auto;
}

.sidebarGroupItemButton:hover {
	color: var(--tla-color-text-1);
}

.sidebarGroupItemButton:focus-visible {
	outline: 2px solid var(--tla-color-focus);
	outline-offset: 2px;
}

.sidebarGroupCreateInput {
	font-size: 12px !important;
	line-height: 1.3;
}

.sidebarGroupCreateInputWrapper {
	margin-bottom: 8px;
}

.CollapsibleContent {
	overflow: hidden;
}

/* Only animate when not during group reordering */
.CollapsibleContent[data-state='open'] {
	animation: slideDown 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.CollapsibleContent[data-state='closed'] {
	animation: slideUp 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
	from {
		height: 0;
	}
	to {
		height: var(--radix-collapsible-content-height);
	}
}

@keyframes slideUp {
	from {
		height: var(--radix-collapsible-content-height);
	}
	to {
		height: 0;
	}
}

.sidebarGroupItemEmpty {
	color: var(--tla-color-text-3);
	font-size: 12px;
	padding: 8px 8px 8px calc(8px + var(--tla-sidebar-group-item-padding-left));
}

.sidebarGroupItemButtonInline {
	display: inline-flex;
	color: var(--tla-color-text-2);
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	cursor: pointer;
	position: relative;
	outline: none;
	border: none;
	background: none;
	margin: 0px;
	padding: 0px;
	font-size: 12px;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sidebarGroupItemButtonInline:hover {
	color: var(--tla-color-text-1);
}

[data-no-animation='true'] * {
	animation-duration: 0s !important;
}
